package com.techstar.ats.status;

import java.util.Set;

public enum TrackStatus implements StatusEnumerated {
	CI_OCCUPIED(0x00000002, "联锁报告区段占用"),
	CBTC_OCCUPIED(0x00000004, "CBTC信息报告轨道占用"),
	LOCKED(0x00000008, "锁闭"),
	FAIL_LOCKED(0x00000010, "故障锁闭"),
	EXPECT_LOCK(0x00000020, "进路办理中，期望锁闭"),
	EXPECT_UNLOCK(0x00000040, "进路取消中，期望解除锁闭"),
	IN_ROUTE(0x00000080, "是否在进路中锁闭，控制是否需要显示锁闭"),
	CUT(0x00000100, "轨道切除"),
	ATC_INVALID(0x00000200, "轨道区段被ATC报告失效"),
	OVERLAP(0x00000400, "OVERLAP"),
	BLOCKED(0x00000800, "轨道区段封锁"),
	CBTC_TSR(0x00100000, "CBTC限速"),
	CI_TSR(0x00200000, "联锁限速"),
	ALL_TSR(0x00400000, "同时限速");

	private final int value;
	private final String literal;

	TrackStatus(int value, String literal) {
		this.value = value;
		this.literal = literal;
	}

	@Override
	public int value() {
		return this.value;
	}

	@Override
	public String literal() {
		return this.literal;
	}

	public static Set<TrackStatus> valueOf(int mask) {
		return StatusEnumerated.valueOf(TrackStatus.class, mask);
	}
}
